//
//  CellOfCellOfOtherDestination.m
//  FreeTravel
//
//  Created by 徐康 on 16/9/7.
//  Copyright © 2016年 KX. All rights reserved.
//
#import "Masonry.h"
#import "CellOfCellOfOtherDestination.h"
@interface CellOfCellOfOtherDestination ()
@property (nonatomic, strong) UILabel *labelOfCnname;
@property (nonatomic, strong) UILabel *labelOfEnname;
@property (nonatomic, strong) UIView *grayLine;
@end
@implementation CellOfCellOfOtherDestination
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.labelOfCnname = [[UILabel alloc]init];
        self.labelOfEnname = [[UILabel alloc]init];
        self.grayLine = [[UIView alloc]init];
        [self.contentView addSubview:self.grayLine];
        [self.contentView addSubview:self.labelOfCnname];
        [self.contentView addSubview:self.labelOfEnname];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    
       [self.labelOfEnname mas_makeConstraints:^(MASConstraintMaker *make) {
           make.top.bottom.equalTo(self.contentView);
           make.left.equalTo(self.labelOfCnname.mas_right);
    }];
    self.labelOfEnname.textColor = [UIColor grayColor];
    self.labelOfEnname.font = [UIFont systemFontOfSize:12];
    
    [self.labelOfCnname mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self.contentView);
    }];
    self.labelOfCnname.font = [UIFont systemFontOfSize:14];
    
    [self.grayLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(self.contentView.mas_width);
        make.height.mas_offset(1);
        make.left.right.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView.mas_bottom);
    }];
    self.grayLine.backgroundColor = [UIColor lightGrayColor];
    
    self.labelOfEnname.textAlignment = NSTextAlignmentCenter;
    self.labelOfCnname.textAlignment = NSTextAlignmentCenter;
}
- (void)setModel:(ModelOfContinentsCountry *)model{
    _model = model;
    
    
    self.labelOfCnname.text = model.cnname;
    self.labelOfEnname.text = model.enname;
    
}
@end
